<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Class header</title>
<link rel="stylesheet" href="../../../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../../../../index.html" title="ODTONE 0.4">
<link rel="up" href="../icmp.html#idp20291344" title="Description">
<link rel="prev" href="filter.html" title="Class filter">
<link rel="next" href="neighbor_advertisement.html" title="Class neighbor_advertisement">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="'ODTONE - Open Dot Twenty One'" width="100" height="100" src="../../../.././images/logo.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="filter.html"><img src="../../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../icmp.html#idp20291344"><img src="../../../../images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../images/home.png" alt="Home"></a><a accesskey="n" href="neighbor_advertisement.html"><img src="../../../../images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="odtone.net.ip.icmp.header"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class header</span></h2>
<p>odtone::net::ip::icmp::header</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../../odtone_net_library.html#header..home.carlos.Projectos.odtone.inc.odtone.net.ip.icmp.icmp_hpp" title="Header &lt;/home/carlos/Projectos/odtone/inc/odtone/net/ip/icmp/icmp.hpp&gt;">/home/carlos/Projectos/odtone/inc/odtone/net/ip/icmp/icmp.hpp</a>&gt;

</span>

<span class="keyword">class</span> <a class="link" href="header.html" title="Class header">header</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// <a class="link" href="header.html#odtone.net.ip.icmp.headerconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="header.html#idp4666904-bb"><span class="identifier">header</span></a><span class="special">(</span><span class="identifier">uint8</span><span class="special">,</span> <span class="identifier">uint8</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="header.html#idp4660720-bb">public static functions</a></span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <span class="keyword">static</span> <span class="identifier">T</span> <span class="special">*</span> <a class="link" href="header.html#idp4660904-bb"><span class="identifier">cast</span></a><span class="special">(</span><span class="keyword">void</span> <span class="special">*</span><span class="special">,</span> <span class="identifier">size_t</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="header.html#idp4663112-bb">public member functions</a></span>
  <span class="identifier">uint8</span> <a class="link" href="header.html#idp4663296-bb"><span class="identifier">type</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">uint8</span> <a class="link" href="header.html#idp4664384-bb"><span class="identifier">code</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="header.html#idp4665472-bb"><span class="identifier">checksum</span></a><span class="special">(</span><span class="identifier">uint16</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idp20386504"></a><h2>Description</h2>
<p>This class represents the header of an ICMP packet. </p>
<div class="refsect2">
<a name="idp20386904"></a><h3>
<a name="odtone.net.ip.icmp.headerconstruct-copy-destruct"></a><code class="computeroutput">header</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><a name="idp4666904-bb"></a><span class="identifier">header</span><span class="special">(</span><span class="identifier">uint8</span> type<span class="special">,</span> <span class="identifier">uint8</span> code<span class="special">)</span><span class="special">;</span></pre>
<p>Construct an ICMP packet header.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">type</code></span></p></td>
<td><p>The ICMP packet header type. </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li></ol></div>
</div>
<div class="refsect2">
<a name="idp20392792"></a><h3>
<a name="idp4660720-bb"></a><code class="computeroutput">header</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <span class="keyword">static</span> <span class="identifier">T</span> <span class="special">*</span> <a name="idp4660904-bb"></a><span class="identifier">cast</span><span class="special">(</span><span class="keyword">void</span> <span class="special">*</span> buffer<span class="special">,</span> <span class="identifier">size_t</span> length<span class="special">)</span><span class="special">;</span></pre>
<p>Convert a byte buffer ICMP packet.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>The pointer of the returning ICMP packet. </p></td>
</tr></tbody>
</table></div>
</li></ol></div>
</div>
<div class="refsect2">
<a name="idp20400432"></a><h3>
<a name="idp4663112-bb"></a><code class="computeroutput">header</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">uint8</span> <a name="idp4663296-bb"></a><span class="identifier">type</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Get the ICMP packet header type.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>The ICMP packet header type. </p></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">uint8</span> <a name="idp4664384-bb"></a><span class="identifier">code</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Get the ICMP packet header code.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>The ICMP packet header code. </p></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp4665472-bb"></a><span class="identifier">checksum</span><span class="special">(</span><span class="identifier">uint16</span> csum<span class="special">)</span><span class="special">;</span></pre>
<p>Set the ICMP packet checksum field.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">csum</code></span></p></td>
<td><p>The ICMP packet checksum field. </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2012 Universidade
      Aveiro<br>Copyright &#169; 2009-2012 Instituto
      de Telecomunica&#231;&#245;es - P&#243;lo Aveiro<p>
        This software is distributed under a license. The full license agreement
        can be found in the LICENSE in this distribution. This software may not be
        copied, modified, sold or distributed other than expressed in the named license
        agreement. This software is distributed without any warranty.
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="filter.html"><img src="../../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../icmp.html#idp20291344"><img src="../../../../images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../images/home.png" alt="Home"></a><a accesskey="n" href="neighbor_advertisement.html"><img src="../../../../images/next.png" alt="Next"></a>
</div>
</body>
</html>
